package auth

import "time"

// 管理员用户模型（占位）
type AdminUser struct {
	ID        int64     `gorm:"primaryKey" json:"id"`
	Username  string    `gorm:"unique;size:100" json:"username"`
	Password  string    `gorm:"size:255" json:"-"`
	Nickname  string    `gorm:"size:100" json:"nickname"`
	Status    int64     `gorm:"default:1" json:"status"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	Roles []*Role `gorm:"many2many:user_role;foreignkey:ID;joinForeignKey:User_ID;joinReferences:Role_ID" json:"roles"`
}

// TableName 设置RoleMenu表名
func (a *AdminUser) TableName() string {
	return "admin"
}